//
//  DYZixunCell.swift
//  SheYangBigData
//
//  Created by 宋海胜 on 2020/12/31.
//  Copyright © 2020 叁拾叁. All rights reserved.
//

import UIKit

class DYZixunCell: SYBaseCell {

    
    fileprivate var bgView: UIView = {
        let v: UIView = UIView()
        v.backgroundColor = .white
        v.layer.cornerRadius = 5
        return v
    }()
    
    let wen: UIImageView = {
        let v: UIImageView = UIImageView()
        v.image = UIImage(named: "wen")
        return v
    }()
    
    let da: UIImageView = {
        let v: UIImageView = UIImageView()
        v.image = UIImage(named: "da")
        return v
    }()
    
    let wenti: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x1A1A1A)
        v.font = 15.autoFontSize()
        
        v.numberOfLines = 0
        return v
    }()
    
    let daan: UILabel = {
        let v:UILabel = UILabel()
        v.textColor = UIColor(hex: 0x999999)
        v.font = 14.autoFontSize()
        
        v.numberOfLines = 0
        return v
    }()
    

    public func configureView(_ model: DYZixunListModel) {
        wenti.text = model.issue
        daan.text = model.answer
    }
    
    override func initViews() {
        
        self.backgroundColor = UIColor(hex: 0xF2F2F2)
        addSubview(bgView)
        bgView.addSubview(wen)
        bgView.addSubview(da)
        bgView.addSubview(wenti)
        bgView.addSubview(daan)
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(10.0.autoWidth())
            make.left.equalToSuperview().offset(autoWidth(15.0))
            make.right.equalToSuperview().offset(autoWidth(-15.0))
            make.bottom.equalToSuperview()
        }
        wen.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(autoWidth(15.0))
            make.left.equalToSuperview().offset(autoWidth(10.0))
            make.width.equalTo(18.0.autoWidth())
            make.height.equalTo(19.0.autoWidth())
        }
        da.snp.makeConstraints { (make) in
            make.top.equalTo(wenti.snp.bottom).offset(autoWidth(17.0))
            make.left.equalToSuperview().offset(autoWidth(10.0))
            make.width.equalTo(18.0.autoWidth())
            make.height.equalTo(19.0.autoWidth())
        }
        wenti.snp.makeConstraints { (make) in
            make.top.equalTo(wen.snp.top).offset(autoWidth(2.5))
            make.left.equalTo(wen.snp.right).offset(autoWidth(7.5))
            make.right.equalToSuperview().offset(autoWidth(-17.5))
        }
        daan.snp.makeConstraints { (make) in
            make.top.equalTo(da.snp.top).offset(autoWidth(2.5))
            make.left.equalTo(da.snp.right).offset(autoWidth(7.5))
            make.right.equalToSuperview().offset(autoWidth(-17.5))
            make.bottom.equalToSuperview().offset(-17.0.autoWidth())
        }
    }
}

